package com.example.utils;

import com.example.DAO.DBUtilsDAO;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class DBUtils implements DBUtilsDAO {
    private static String url = "jdbc:mysql://localhost:3306/user_data";
    private static String user = "root";
    private static String password = "123456";

    public DBUtils() {
    }

    public Connection getConnection() throws SQLException {
        try {
            Class.forName("com.mysql.cj.jdbc.Driver");
            return DriverManager.getConnection(url, user, password);
        } catch (ClassNotFoundException e) {
            throw new RuntimeException(e);
        }
    }
}